﻿using Infinity.Common.Logger;
using Infinity.Compilers;
using Infinity.Expressions.Constant;
using Infinity.Expressions.Operator;
using Infinity.Statements;
using Infinity.Statements.Program;

namespace Infinity.Expressions
{
	/// <summary>
	/// Factory interface for creating expressions
	/// </summary>
	public interface IExpressionFactory
	{
		ILogger Logger { get; set; }
		IStatementFactory StatementFactory { get; set; }

		IConstantExpression CreateNumberConstant(double value);
		IRangeExpression CreateRangeConstant(IExpression minimum, IExpression maximum, IExpression by);
		ISetExpression CreateSetConstant(params IExpression[] items);
		IBooleanExpression CreateBooleanConstant(bool value);
		IStringExpression CreateStringConstant(string value);

		ILazySetExpression CreateLazySetConstant(
			IVariableStatement[] lazySetVariables, IExpression expression, IExpression condition);

		ITupleExpression CreateTupleConstant(params IExpression[] expressions);

		IAccessOperatorExpression CreateAccessExpression();

		IExpression CreateReference(string value);
		IIdentifierExpression CreateIdentifier(string name);
		IExpression CreateSymbol(string value);

		IExpression CreateExpression(params IExpression[] expressions);

		IExpression CreateIndexer(params IExpression[] expressions);
		IVariableStatement CreateLazySetIdentifier(string name, IExpression value);
	}
}